package com.example.onlinemusic.controller;

import com.example.onlinemusic.common.R;
import com.example.onlinemusic.service.ListSongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ListSongController {

    @Autowired
    ListSongService listSongService;

    /**
     * 根据歌单ID获取歌单歌曲列表
     *
     * @param songListId
     * @return
     */
    @GetMapping("/listSong/detail")
    public R getSongs(@RequestParam int songListId) {
        return listSongService.getSongsOfList(songListId);
    }
}
